require('../../assets/css/index.less');
require('./login.less')
let local=require('../../utils/local')
let dom = require('../../utils/dom.js');
let https=require('../../utils/https')
dom.ready(function () {
    dom.getEle('.btn').addEventListener('click', function () {
        https.post('/api/user/login', {
            account: account.value,
            password:password.value
        }, function (res) {
            console.log(res);
            if (res.errno == 0) {
                localStorage.setItem('tk',res.data.token);
                window.location.href='/home.html'
            } else {
                alert(res.message)
           }
        })
    })
})